<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/4/20 0020
 * Time: 下午 15:03
 */

namespace Home\Model;
use Think\Model;

class CollectModel extends Model{
    //获取当前用户的所有收藏信息
    public function search($userid){
        $info = D()->query("select b.wzno,b.wzmc,b.dhbs,c.flmc,d.qc from collect a
                            left join b_c_wzbm b on a.wzno=b.wzno
                            left join b_c_wzfl c on b.wzfl=c.flno
                            left join b_p_gysjbqk d on b.gysno=d.gysno
                            where a.user_id='{$userid}'");
        foreach($info as $k=>&$v){
            $row = explode(' ',$v['dhbs']);
            $v['dhbs'] = array($row[0],$row[1],$row[2]);
        }

        //dump($info);exit;
        return $info;
    }

}